home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / develop™ Technical Journal / develop Issue 25 code / Display Manager Sample / Headers / Proto.h < prev   
Encoding:
C/C++ Source or Header  |  1995-12-19  |  4.9 KB  |  149 lines  |  [TEXT/MPCC]

  1. /***********************************************************************
  2. #
  3. #        Proto.h
  4. #
  5. #        This file contains the prototypes for the apps procs and funcs
  6. #
  7. #        Author: Michael Marinkovich
  8. #                Apple Developer Technical Support
  9. #
  10. #
  11. #        Modification History: 
  12. #
  13. #            6/4/95        MWM     Initial coding                     
  14. #            10/12/95    MWM        cleaned up
  15. #
  16. #        Copyright © 1992-95 Apple Computer, Inc., All Rights Reserved
  17. #
  18. #
  19. ***********************************************************************/
  20.  
  21. #include <Displays.h>
  22.  
  23. //----------------------------------------------------------------------
  24. //
  25. //    Aevt
  26. //
  27. //----------------------------------------------------------------------
  28.  
  29. OSErr             AEInit(void);
  30. pascal OSErr    DoAEOpenApp(AppleEvent event,AppleEvent reply,long refCon);
  31. pascal OSErr    DoAEQuitApp(AppleEvent event,AppleEvent reply,long refCon);
  32. pascal OSErr    DoAEOpenDoc(AppleEvent event,AppleEvent reply,long refCon);
  33. pascal OSErr    DoAEPrintDoc(AppleEvent event,AppleEvent reply,long refCon);
  34. OSErr             GotAEParams(AppleEvent *appleEvent);
  35.  
  36.  
  37. //----------------------------------------------------------------------
  38. //
  39. //    Initialize
  40. //
  41. //----------------------------------------------------------------------
  42.  
  43. OSErr            Initialize(void);
  44. void            ToolBoxInit(void);
  45. void             CheckEnvironment(void);
  46. OSErr             InitApp(void);
  47. void             MenuSetup(void);
  48.  
  49.  
  50. //----------------------------------------------------------------------
  51. //
  52. //    Main
  53. //
  54. //----------------------------------------------------------------------
  55.  
  56.  
  57. void             HandleError(short errNo,Boolean fatal);
  58. void             HandleAlert(short alertID);
  59.  
  60.  
  61. //----------------------------------------------------------------------
  62. //
  63. //    Events
  64. //
  65. //----------------------------------------------------------------------
  66.  
  67. void            EventLoop(void);
  68. short             MyGetSleep(void);
  69. void             CustomWindowEvent(short eventType,WindowRef window,void *refCon);
  70. void             DoEvent(EventRecord *event);
  71. void             DoIdle(WindowRef window, void *refCon);
  72. void             HandleMouseDown( EventRecord *event );
  73. void             HandleMenuChoice( WindowRef window, void *refCon );
  74. void            HandleContentClick( WindowRef window, void *refCon );
  75. void             HandleZoomClick( WindowRef window, void *refCon );
  76. void             HandleGrow(WindowRef window, void *refCon);
  77. void             UpdateWindow(WindowRef window);
  78. void             DoActivate(WindowRef window, void *refCon);
  79.  
  80.  
  81. //----------------------------------------------------------------------
  82. //
  83. //    Windows
  84. //
  85. //----------------------------------------------------------------------
  86.  
  87. WindowPtr         CreateWindow(short resID, void *wStorage, Rect *bounds, Str255 title,
  88.                             Boolean visible, short procID,short kind, WindowRef behind,
  89.                             Boolean goAwayFlag,long refCon);
  90. OSErr             RemoveWindow(WindowRef window);
  91. void             NewWindowTitle(WindowRef window, Str255 str);
  92. OSErr             InitWindowProcs(WindowRef window, short windKind);
  93. GWorldPtr        PictToWorld(PicHandle pict, OSErr *rtnErr);
  94. void            DrawWindow( WindowRef window, void *refCon );
  95. void             DrawAboutWindow( WindowRef window, void *refCon );
  96. void             DoResizeWindow (WindowRef window);
  97. short             GetWindKind(WindowRef window);
  98. Boolean            GetIsAppWindow(WindowRef window);
  99. Boolean         GetIsAboutWindow( WindowRef window );
  100.  
  101.  
  102. //----------------------------------------------------------------------
  103. //
  104. //    Displays
  105. //
  106. //----------------------------------------------------------------------
  107.  
  108. OSErr             InstallDMNotification(void);
  109. OSErr             InstallAEDMNotification(void);
  110. OSErr             RemoveDMNotification(void);
  111. OSErr             InstallDMNotificationAE(void);
  112. pascal OSErr     WorldChangedProc(AppleEvent *event);
  113. pascal OSErr     DoAEDisplayUpdate(AppleEvent event,AppleEvent reply,long refCon);
  114. OSErr             HandleNotification(AppleEvent *event);
  115. OSErr             HandleDeviceChange(DisplayIDType displayID, Rect *newRect);
  116. Boolean         OutOfBoundsRect(GDHandle gd, WindowRef window, Rect screenRect);
  117. void             MoveInbounds(WindowRef window, GDHandle gd, Rect screenRect);
  118. void            ResizeInbounds(WindowRef window, GDHandle gd, Rect screenRect);
  119. GDHandle         GetGreatestDevice(WindowRef window);
  120. void             GetWindowRect(WindowRef window, Rect *windRect);
  121. void             ResetStdState(WindowRef window);
  122.  
  123.  
  124. //----------------------------------------------------------------------
  125. //
  126. //    Scrolls
  127. //
  128. //----------------------------------------------------------------------
  129.  
  130. void             InstallScrollBars(WindowRef window, DocHnd doc);
  131. void             AdjustScrollValues(WindowRef window);
  132. void             AdjustScrollbars(WindowRef window, Boolean resize);
  133. pascal void     ScrollActionProc(ControlRef control, short part);
  134. void            ScrollPict(short hAmount,short vAmount,WindowRef window);
  135. void             MyScrollPicture(WindowRef window, short hs, short vs);
  136. void             GetContRect(WindowRef window,Rect *contRect);
  137.  
  138.  
  139. //----------------------------------------------------------------------
  140. //
  141. //    Utils
  142. //
  143. //----------------------------------------------------------------------
  144.  
  145. void            DoOpenNew(void);    
  146. PicHandle         ReadFile(FSSpec spec);
  147. void            ZeroRect(Rect *r);
  148. void             pstrcpy(StringPtr dst, StringPtr src);
  149. void             pstrcat(StringPtr dst, StringPtr src);